if __name__ == '__main__':
    res = 0
    for i in str(pow(2, 1000)):
        res += int(i)
    print(res)